import list from '@/views/Home/HomeRedux.js';
import {createStore, applyMiddleware} from 'redux';
import createFetchMiddleware from 'redux-composable-fetch';

const FetchMiddleware = createFetchMiddleware({
  afterFetch({ action, result }) {
    console.log(result)
    return result.json().then(data => {
      console.log(data)
      return Promise.resolve({
        action,
        result: data,
      });
    });
  },
});

export default createStore(list, applyMiddleware(FetchMiddleware));